Skip to content

[fix](be) Fix missing decimal precision and scale for legacy decimal data (#65419)#65521

Open
jacktengg wants to merge 2 commits into
apache:branch-4.0from
jacktengg:4.0-pick-dec-precision
Open

[fix](be) Fix missing decimal precision and scale for legacy decimal data (#65419)#65521
jacktengg wants to merge 2 commits into
apache:branch-4.0from
jacktengg:4.0-pick-dec-precision

Conversation

@jacktengg

Copy link
Copy Markdown
Contributor

Issue Number: close #xxx

Pick #65419

Related PR: #26572, #63569

Problem Summary:

Segments written before decimal ColumnMetaPB precision and scale were persisted can miss precision and scale for decimal types in metadata . Regular columns, complex decimal children may then build decimal DataType instances without the logical precision/scale from TabletSchema, and result in error "Wrong precision 0, min: 1, max: 76". This change centralizes decimal metadata recovery from TabletSchema, applies it before ColumnReader/DataType creation.

Fix reading legacy decimal whose segment metadata is missing decimal precision and scale.

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
  • This is a refactor/code format and no logic has been changed.
    - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason

  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
  • Yes.

  • Confirm the release note

  • Confirm test cases

  • Confirm document

  • Add branch pick label

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

…data (apache#65419)

Issue Number: close #xxx

Related PR: apache#26572, apache#63569

Problem Summary:

Segments written before decimal ColumnMetaPB precision and scale were
persisted can miss precision and scale for decimal types in metadata .
Regular columns, complex decimal children may then build decimal
DataType instances without the logical precision/scale from
TabletSchema, and result in error "Wrong precision 0, min: 1, max: 76".
This change centralizes decimal metadata recovery from TabletSchema,
applies it before ColumnReader/DataType creation.

Fix reading legacy decimal whose segment metadata is missing decimal
precision and scale.

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
@jacktengg jacktengg requested a review from morningman as a code owner July 13, 2026 06:52
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@jacktengg

Copy link
Copy Markdown
Contributor Author

run buildall

@jacktengg

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 89.13% (41/46) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.51% (19566/36562)
Line Coverage 36.58% (183049/500377)
Region Coverage 33.15% (142316/429312)
Branch Coverage 34.02% (61533/180893)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 91.30% (42/46) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.53% (25588/35770)
Line Coverage 54.42% (271382/498720)
Region Coverage 51.98% (224925/432744)
Branch Coverage 53.39% (96806/181315)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants